package com.yic.module.system.controller.admin.code.vo;

import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;

import javax.validation.Valid;
import javax.validation.constraints.*;

@Schema(description = "管理后台 - 编号规则创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class CodeCreateReqVO extends CodeBaseVO {

    @Schema(description = "编码规则", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "规则不能为空")
    @Valid
    private List<CodeCreateReqVO.Rule> rules;

    @Schema(description = "规则")
    @Data
    public static class Rule {

        @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
        private Long id;

        @Schema(description = "规则类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "字符串")
        @NotNull(message = "规则类型不能为空")
        private String type;

        @Schema(description = "规则标准", requiredMode = Schema.RequiredMode.REQUIRED, example = "字符串")
        private String param;

        @Schema(description = "规则标准排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
        private Integer serial;

    }

}
